import 'package:flutter/material.dart';
import 'dart:async';

class LoadingPage extends StatefulWidget {
  @override
  _LoadingState createState() => new _LoadingState();
}

class _LoadingState extends State<LoadingPage> {
  @override
  void initState() {
    super.initState();
    new Future.delayed(Duration(milliseconds: 600), () {
      print("loading···");
      Navigator.of(context)
          .pushReplacementNamed("/app"); // 这里不返回加载页，所以不能用pushNamed
    });
  }

  @override
  Widget build(BuildContext context) {
    return new Center(
      child: Stack(
        children: <Widget>[
          Image.asset(
            "assets/images/loading.jpeg",
            fit: BoxFit.cover,
          ),
        ],
      ),
    );
  }
}
